package com.example.demo;

import org.springframework.boot.Banner;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;

/**
 * @SpringBootApplication -->SpringBoot会自动扫描所在类的同级包以及下级包里的bean
 * exclude:关闭特定的自动配置
 * application.setBannerMode(Banner.Mode.OFF);关闭启动图案
 * @author huzhan150
 *
 */
@SpringBootApplication(exclude ={DataSourceAutoConfiguration.class})
public class DemoApplication {

	public static void main(String[] args) {
		//SpringApplication.run(DemoApplication.class, args);
//		1.SpringApplication.run(Application.class,args);
//		2.SpringApplication application = new SpringApplication(DemoApplication.class);
//		Banner banner = new Banner();
//		application.setBanner(banner);
//		application.setBannerMode(Banner.Mode.OFF);
//		application.run(args);
		
		//fluent API
		new SpringApplicationBuilder(DemoApplication.class)
			.bannerMode(Banner.Mode.OFF)
			.run(args);
	}
}
